/*
 * @Author: LCL 
 * @Date: 2019-03-08 20:36:30
 * @Desc: 楼梯item管理器
*/

const {ccclass, property} = cc._decorator;

@ccclass
export default class LadderItemControl extends cc.Component {

    @property(cc.Sprite)
    iconSpri: cc.Sprite = null;

    @property(cc.Sprite)
    itemSpri: cc.Sprite = null;

    public endP : cc.Vec2

    

    //楼梯相对于前面一个的位置
    //装饰楼梯 -2 -1 0 1 2
    //正式楼梯 -1 1
    type : number = 1;
    index : number = 0;//第几层楼梯
    role : number = 1;// 1 正常  2装饰


    // onLoad (, ) {}

    start () {

    }

    /**
     * 
     * @param index 第几层楼梯
     * @param type  楼梯位置
     */
    public initDataView(index : number, type : number, role:number, iconFrame:cc.SpriteFrame, itemFrame:cc.SpriteFrame){
        this.index = index;
        this.type = type;
        this.role = role;
        this.iconSpri.spriteFrame = iconFrame;
        if(role ==2 ){
            this.itemSpri.node.active = true;
            this.itemSpri.spriteFrame = itemFrame;
        }
        else{
            this.itemSpri.node.active = false;
            this.itemSpri.spriteFrame = itemFrame;
        }
        
        // this.iconSpri.node.setContentSize(iconFrame.getOriginalSize());
        this.node.zIndex = -index;

    }

    // update (dt) {}
}


/*
public void TEXT1() 
{
	int textNum = 1;
	if (textNum == 1) 
	{
		textNum = 2;
    }
}
public void TEXT2()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}
public void TEXT3()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT4()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT5()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT6()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT8()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT9()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT10()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT11()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT12()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT13()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT14()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT15()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT16()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT17()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}
*/
